import request from '@/utils/request'
// 居民信息列表
export async function getResidentList(data) {
  return request({
    url: '/baseResident/pageQuery',
    method: 'post',
    data,
  })
}
// 获取街道信息
export function getTownList() {
  return request({
    url: '/baseResident/getTownList',
    method: 'get',
  })
}
// 获取小区信息
export function getAreaList(townId) {
  return request({
    url: '/baseResident/getAreaList/' + townId,
    method: 'get',
  })
}
// 获取楼宇信息
export function getBuilderList(areaId) {
  return request({
    url: '/baseResident/getBuilderList/' + areaId,
    method: 'get',
  })
}
// 获取房间信息
export function getRoomList(builderId) {
  return request({
    url: '/baseResident/getRoomList/' + builderId,
    method: 'get',
  })
}
// 新增居民信息
export function addResident(data) {
  return request({
    url: '/baseResident/save',
    method: 'post',
    data,
  })
}
// 返回上传地址
export const uploadUrl = '/baseResident/uploadPic'
// 审核居民信息
export async function updateAudit(residentId, status) {
  return request({
    url: `/baseResident/updateAuditStatus?residentId=${residentId}&status=${status}`,
    method: 'post',
    data: {},
  })
}
// 删除居民信息
export async function deleteResidentById(id) {
  return request({
    url: `/baseResident/deleteById?id=${id}`,
    method: 'post',
    data: {},
  })
}
// 获取单个的居民信息
export function getResidentById(id) {
  return request({
    url: `/baseResident/findById/${id}`,
    method: 'get',
  })
}
// 修改居民信息
export async function updateResident(data) {
  return request({
    url: `/baseResident/updateWithoutNull`,
    method: 'post',
    data,
  })
}
// 导出居民信息
export function exportResident() {
  return request({
    url: `/baseResident/exportResident`,
    method: 'post',
    data: {},
  })
}

// 北控推送居民信息
export async function getNorthResidentList(data) {
  return request({
    url: '/baseBkResident/pageQuery',
    method: 'post',
    data,
  })
}
// 北控推送居民信息-删除
export async function deleteNorthResidentById(id) {
  return request({
    url: `/baseBkResident/deleteByIdLogic?id=${id}`,
    method: 'post',
    data: {},
  })
}
// 北控推送访客信息
export async function getNorthGuestList(data) {
  return request({
    url: '/baseBkGuest/pageQuery',
    method: 'post',
    data,
  })
}
// 北控推送访客信息-删除
export async function deleteNorthGuestById(id) {
  return request({
    url: `/baseBkGuest/deleteByIdLogic?id=${id}`,
    method: 'post',
    data: {},
  })
}
// 北控推送房屋信息
export async function getNorthHouseList(data) {
  return request({
    url: '/baseBkHouse/pageQuery',
    method: 'post',
    data,
  })
}
// 北控推送房屋信息-删除
export async function deleteNorthHouseById(id) {
  return request({
    url: `/baseBkHouse/deleteByIdLogic?id=${id}`,
    method: 'post',
    data: {},
  })
}
//
// 查询房屋信息
export async function getNorthUserById(id) {
  return request({
    url: `/baseBkResident/findById/${id}`,
    method: 'get',
  })
}
// 上传文件路径
export const uploadResidentUrl = `/baseResident/importResident`
export const downloadTemplateUrl = '/bfs/template/居民导入模板.xlsx'
